import { device0 } from "./device_0";
import { device1 } from "./device_1";
import { device2 } from "./device_2";
import { device3 } from "./device_3";
import { device4 } from "./device_4";
import { device5 } from "./device_5";
import { device6 } from "./device_6";
import { device7 } from "./device_7";
import { device8 } from "./device_8";
import { device9 } from "./device_9";

import { light_0 } from "./light_0";
import { electric_0 } from "./electric_0";
import { largeSys_0 } from "./largeSys_0";
import { smallSys_1 } from "./smallSys_1";
import { smallSys_2 } from "./smallSys_2";
import { smallSys_3 } from "./smallSys_3";
import { found_0 } from "./found_0";

import { model_1 } from "./model_1";
import { model_2 } from "./model_2";
import { model_3 } from "./model_3";
import { model_4 } from "./model_4";
import { model_5 } from "./model_5";
import { model_6 } from "./model_6";

const modules: any = import.meta.glob("/public/devices/**/*.png", { eager: true });
let map = {};
for (let key in modules) {
  let arr = key.split("/");
  let name = arr[arr.length - 1].replace(/.png/, "");
  map[name] = process.env.VITE_APP_ENV === "production" ? key.replace(/\/public/, "") : modules[key].default;
}
// console.log(2222222, process.env.VITE_APP_ENV, map);
/**
 * icon： 地图上显示的图标地址 可以为空 （todo：地址状态切换 功能 ）
 * label : 地图上显示的label 可以为空
 * deviceName : 弹窗显示的设备名称
 */
export const devicePoint = {
  device_0: device0(map),
  device_1: device1(map),
  device_2: device2(map),
  device_3: device3(map),
  device_4: device4(map),
  device_5: device5(map),
  device_6: device6(map),
  device_7: device7(map),
  device_8: device8(map),
  device_9: device9(map),
  light_0: light_0(map),
  electric_0: electric_0(map),
  largeSys_0: largeSys_0(map),
  smallSys_1: smallSys_1(map),
  smallSys_2: smallSys_2(map),
  smallSys_3: smallSys_3(map),
  found_0: found_0(map),
  model_1: model_1(map),
  model_2: model_2(map),
  model_3: model_3(map),
  model_4: model_4(map),
  model_5: model_5(map),
  model_6: model_6(map)
};
